package com.seuic.hnjiningposapp.hnapps.ui.view.dialog;

import android.content.Context;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.BasePopupView;
import com.seuic.hnjiningposapp.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 挂失成功
 */
public class SellOSSuccessPp extends BasePopupView {
    Unbinder bind;
    @BindView(R.id.card_num_tv)
    TextView cardNumTv;
    @BindView(R.id.username)
    TextView username;
    @BindView(R.id.success_ok_btn)
    Button successOkBtn;
    SuccessPpCallbACK mSuccessPpCallbACK;

    public SellOSSuccessPp(@NonNull Context context, SuccessPpCallbACK successPpCallbACK) {
        super(context);
        mSuccessPpCallbACK = successPpCallbACK;

    }

    @Override
    protected int getPopupLayoutId() {
        return R.layout.selossuccess_pp_layout;
    }


    public void setCardnum(String cardnum) {
        this.cardnum = cardnum;
    }

    public void setName(String name) {
        this.name = name;
    }

    String cardnum;
    String name;

    @Override
    protected void onCreate() {
        super.onCreate();
        bind = ButterKnife.bind(this);
        cardNumTv.setText(cardnum);
        username.setText(name);
    }

    @Override
    protected void onDismiss() {
        super.onDismiss();
        //注解解绑
        if (bind != null && bind != Unbinder.EMPTY) {
            bind.unbind();
        }
        this.bind = null;
    }

    public interface SuccessPpCallbACK {
        void PpCallbACK();
    }

    @OnClick(R.id.success_ok_btn)
    public void onViewClicked() {
        mSuccessPpCallbACK.PpCallbACK();
    }
}
